From 7405ad3999c633d31ba3e06e8c66c11d9b907933 Mon Sep 17 00:00:00 2001 From: robin Date: Mon, 17 Sep 2012 02:52:55 +0200 Subject: [PATCH] Use number input type for year in dateMenu Use the HTML5 number input type for the year input field in the dateMenu (used on e.g. history pages), since a year is always a number :) (There was once a year type proposed, but that didn't make it into HTML5) Patchset 2: use Html::input instead of Xml::input (and change the other Xml's to self::) Change-Id: If9ad28566abfc02a164367d7cdd6992939169c0a --- includes/Xml.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/Xml.php b/includes/Xml.php index 120312dd96..4a55d5e7ce 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -198,10 +198,11 @@ class Xml { } else { $encYear = ''; } - return Xml::label( wfMessage( 'year' )->text(), 'year' ) . ' '. - Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) . ' '. - Xml::label( wfMessage( 'month' )->text(), 'month' ) . ' '. - Xml::monthSelector( $encMonth, -1 ); + $inputAttribs = array( 'id' => 'year', 'maxlength' => 4, 'size' => 7 ); + return self::label( wfMessage( 'year' )->text(), 'year' ) . ' '. + Html::input( 'year', $encYear, 'number', $inputAttribs ) . ' '. + self::label( wfMessage( 'month' )->text(), 'month' ) . ' '. + self::monthSelector( $encMonth, -1 ); } /** -- 2.20.1